// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   MaxMinDataSerie.java

package com.java4less.rchart;

import com.java4less.rchart.gc.ChartColor;
import com.java4less.rchart.gc.GraphicsProvider;
import java.util.Vector;

// Referenced classes of package com.java4less.rchart:
//			LineDataSerie, LineStyle

public class MaxMinDataSerie extends LineDataSerie
{

	Vector maxData;
	Vector minData;
	Vector closeData;
	public boolean drawLineEnd;
	public LineStyle maxminStyle;
	public boolean bubbleChart;
	public boolean fillBubble;
	public ChartColor positiveValueColor;
	public ChartColor negativeValueColor;
	public int openCloseWidth;

	public MaxMinDataSerie(LineStyle s)
	{
		super(s);
		maxData = new Vector(0, 5);
		minData = new Vector(0, 5);
		closeData = new Vector(0, 5);
		drawLineEnd = true;
		maxminStyle = new LineStyle(0.2F, GraphicsProvider.getColor(ChartColor.BLACK), 1);
		bubbleChart = false;
		fillBubble = true;
		positiveValueColor = GraphicsProvider.getColor(ChartColor.WHITE);
		negativeValueColor = GraphicsProvider.getColor(ChartColor.RED);
		openCloseWidth = 7;
	}

	public MaxMinDataSerie(double x[], double y[], LineStyle s)
	{
		super(x, y, s);
		maxData = new Vector(0, 5);
		minData = new Vector(0, 5);
		closeData = new Vector(0, 5);
		drawLineEnd = true;
		maxminStyle = new LineStyle(0.2F, GraphicsProvider.getColor(ChartColor.BLACK), 1);
		bubbleChart = false;
		fillBubble = true;
		positiveValueColor = GraphicsProvider.getColor(ChartColor.WHITE);
		negativeValueColor = GraphicsProvider.getColor(ChartColor.RED);
		openCloseWidth = 7;
	}

	public MaxMinDataSerie(double y[], LineStyle s)
	{
		super(y, s);
		maxData = new Vector(0, 5);
		minData = new Vector(0, 5);
		closeData = new Vector(0, 5);
		drawLineEnd = true;
		maxminStyle = new LineStyle(0.2F, GraphicsProvider.getColor(ChartColor.BLACK), 1);
		bubbleChart = false;
		fillBubble = true;
		positiveValueColor = GraphicsProvider.getColor(ChartColor.WHITE);
		negativeValueColor = GraphicsProvider.getColor(ChartColor.RED);
		openCloseWidth = 7;
	}

	public MaxMinDataSerie(Double y[], LineStyle s)
	{
		super(y, s);
		maxData = new Vector(0, 5);
		minData = new Vector(0, 5);
		closeData = new Vector(0, 5);
		drawLineEnd = true;
		maxminStyle = new LineStyle(0.2F, GraphicsProvider.getColor(ChartColor.BLACK), 1);
		bubbleChart = false;
		fillBubble = true;
		positiveValueColor = GraphicsProvider.getColor(ChartColor.WHITE);
		negativeValueColor = GraphicsProvider.getColor(ChartColor.RED);
		openCloseWidth = 7;
	}

	public MaxMinDataSerie(double op[], double cl[], double hi[], double lo[], LineStyle s)
	{
		super(op, s);
		maxData = new Vector(0, 5);
		minData = new Vector(0, 5);
		closeData = new Vector(0, 5);
		drawLineEnd = true;
		maxminStyle = new LineStyle(0.2F, GraphicsProvider.getColor(ChartColor.BLACK), 1);
		bubbleChart = false;
		fillBubble = true;
		positiveValueColor = GraphicsProvider.getColor(ChartColor.WHITE);
		negativeValueColor = GraphicsProvider.getColor(ChartColor.RED);
		openCloseWidth = 7;
		for (int i = 0; i < op.length; i++)
		{
			maxData.addElement(new Double(hi[i]));
			minData.addElement(new Double(lo[i]));
			closeData.addElement(new Double(cl[i]));
		}

	}

	public MaxMinDataSerie(Double op[], double cl[], double hi[], double lo[], LineStyle s)
	{
		super(op, s);
		maxData = new Vector(0, 5);
		minData = new Vector(0, 5);
		closeData = new Vector(0, 5);
		drawLineEnd = true;
		maxminStyle = new LineStyle(0.2F, GraphicsProvider.getColor(ChartColor.BLACK), 1);
		bubbleChart = false;
		fillBubble = true;
		positiveValueColor = GraphicsProvider.getColor(ChartColor.WHITE);
		negativeValueColor = GraphicsProvider.getColor(ChartColor.RED);
		openCloseWidth = 7;
		for (int i = 0; i < op.length; i++)
		{
			maxData.addElement(new Double(hi[i]));
			minData.addElement(new Double(lo[i]));
			closeData.addElement(new Double(cl[i]));
		}

	}

	public void addOHLCData(Object op, Object cl, Object max, Object min)
	{
		maxData.addElement(max);
		minData.addElement(min);
		closeData.addElement(cl);
		addData(new Double(xData.size() + 1), op);
	}

	public void addMaxMinData(Object max, Object min)
	{
		maxData.addElement(max);
		minData.addElement(min);
	}

	public void setMaxMinValues(double Max[], double Min[])
	{
		for (int i = 0; i < Max.length; i++)
			if (Min != null)
				addMaxMinData(new Double(Max[i]), new Double(Min[i]));
			else
				addMaxMinData(new Double(Max[i]), null);

	}
}
